﻿/************************************************************************
 * Copyright (c) 2008, Jason Whitehorn (jason.whitehorn@gmail.com)
 * All rights reserved.
 * 
 * Source code and binaries distributed under the terms of the included
 * license, see license.txt for details.
 ************************************************************************/
using System;
using System.Collections.Generic;
using System.Text;

namespace ContractTest.Assertions {
    /// <summary>
    /// Represents an asserter for type related contracts.
    /// </summary>
    public interface ITypeAsserter {
        /// <summary>
        /// Asserts that the type is a class.
        /// </summary>
        /// <typeparam name="T">The type to test.</typeparam>
        void IsClass<T>();
        /// <summary>
        /// Asserts that the type is an enumeration.
        /// </summary>
        /// <typeparam name="T">The type to test.</typeparam>
        void IsEnum<T>();
        /// <summary>
        /// Asserts that the type is an interface.
        /// </summary>
        /// <typeparam name="T">The type to test.</typeparam>
        void IsInterface<T>();

        /// <summary>
        /// Asserts that the type has a default constructor of any visibility, including private.
        /// </summary>
        /// <typeparam name="T">The type to test.</typeparam>
        void HasDefaultConstructor<T>();
        /// <summary>
        /// Asserts that the type lacks a default constructor of any visibility, including private.
        /// </summary>
        /// <typeparam name="T">The type to test.</typeparam>
        void LacksDefaultConstructor<T>();
        /// <summary>
        /// Asserts that the type has a default constructor of public visibility.
        /// </summary>
        /// <typeparam name="T">The type to test.</typeparam>
        void HasPublicDefaultConstructor<T>();
        /// <summary>
        /// Asserts that the type has a default constructor of private visibility.
        /// </summary>
        /// <typeparam name="T">The type to test.</typeparam>
        void HasPrivateDefaultConstructor<T>();
        /// <summary>
        /// Asserts that the type lacks a default constructor of public visibility.
        /// </summary>
        /// <typeparam name="T">The type to test.</typeparam>
        void LacksPublicDefaultConstructor<T>();
        /// <summary>
        /// Asserts that the type has a default constructor no more exposed 
        /// than the specified visibility level. Types lacking default
        /// constructors allways pass.
        /// </summary>
        /// <typeparam name="T">The type to test.</typeparam>
        /// <param name="maxVisibility">The maximum allowed visibility for the default constructor.</param>
        void DefaultConstructorHasMaxVisibility<T>(VisibilityModifier maxVisibility);
        /// <summary>
        /// Asserts that the type has a default constructor no less exposed 
        /// than the specified visibility level. Types lacking default
        /// constructors allways fail.
        /// </summary>
        /// <typeparam name="T">The type to test.</typeparam>
        /// <param name="minVisibility">The minimum allowed visibility for the default constructor.</param>
        void DefaultConstructorHasMinVisibility<T>(VisibilityModifier minVisibility);

        /// <summary>
        /// Asserts that the type's visibility is public.
        /// </summary>
        /// <typeparam name="T">The type to test the visibility of.</typeparam>
        void IsPublic<T>();
        /// <summary>
        /// Asserts that the type's visibility is internal.
        /// </summary>
        /// <typeparam name="T">The type to test the visibility of.</typeparam>
        void IsInternal<T>();
        /// <summary>
        /// Asserts that the specified type is abstract.
        /// </summary>
        /// <typeparam name="T">The type to test.</typeparam>
        void IsAbstract<T>();
    }
}
